'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	// console.log('event : ', event)
	const db = uniCloud.database();
	const dbCmd = db.command;
	const action = event.action;
	let dbRes;
	if(action == "get"){
		dbRes = await db.collection("swiper").orderBy("_id","desc").get()
	}else if(action == "getFloor"){
		dbRes = await db.collection("floor").orderBy("_id","desc").get()
	}
	//返回数据给客户端
	return dbRes?dbRes.data:null;
};
